package run;

import java.io.IOException;

import pso.PSO_Focal;
import pso.PSO_Global;
import pso.PSO_Local;
import function.Function;
import function.Rastrigin;
import ga.GA_Constants;

public class Run {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		
		try {
			FileWrite.writeInFile("fitness"+ "\t"+ "iteracao" + "\t"+ "exp" + "\n", "./resultadosPSO//" + "exp10PSO");
			FileWrite.writeInFile("fitness"+ "\t"+ "iteracao" + "\t"+ "exp" + "\n", "./resultadosPSO//" + "exp11PSO");
			FileWrite.writeInFile("fitness"+ "\t"+ "iteracao" + "\t"+ "exp" + "\n", "./resultadosPSO//" + "exp12PSO");
			
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		Function ras = new Rastrigin();
		//PSO_Local pso = new PSO_Local(ras, 30, 10000, string outputfilename); <-
		PSO_Global psoGlobal;
		for (int i = 0; i < 1; i++) {
			psoGlobal = new PSO_Global(ras, 5, 10001 , "exp10PSO");
			System.out.println(i);
			psoGlobal.run();
		}
		
		
		PSO_Local psoLocal;
		
		System.out.println("Fim");
		for (int i = 0; i < 30; i++) {
			psoLocal = new PSO_Local(ras, 20, 10001 , "exp11PSO");
			System.out.println(i);
			psoLocal.run();
		}
		
		PSO_Focal psoFocal;
		
		System.out.println("Fim");
		for (int i = 0; i < 30; i++) {
			psoFocal = new PSO_Focal(ras, 25, 10001 , "exp12PSO");
			System.out.println(i);
			psoFocal.run();
		}
		System.out.println("Fim");
		
		
		
		
			
	}

}
